﻿
using System;

namespace RouteMaster
{
    public class RouteLeg
    {
        public readonly BusRoute _busRoute;
        public readonly BusStop _busStopStart;

        public RouteLeg(BusRoute busRoute, BusStop busStopStart )
        {
            if (busRoute != null)
            {
                if (!busRoute.IsStopOnRoute(busStopStart.ID))
                    throw new ArgumentException("Bad route leg start busstop- " + busStopStart);
            }

            _busRoute = busRoute;
            _busStopStart = busStopStart;
        }

        public override string ToString()
        {
            return _busStopStart + ", " +_busRoute;
        }
    }
}
